# -*- coding: utf-8 -*-
# @Time : 2022/1/4 19:46
# @Author : Limusen
# @File : demo_browser_22

import os
from selenium import webdriver
# 引入系统类
import sys

# 获取项目顶层路径
current_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
# print(current_path)

# 谷歌驱动地址
chrome_path = os.path.join(current_path, 'webdriver', 'chrome', 'chromedriver93.exe')
# print(chrome_path)

# 火狐驱动地址
firefox_path = os.path.join(current_path, 'webdriver', 'firefox', 'geckodriver.exe')
# print(firefox_path)

# 　edge驱动地址
edge_path = os.path.join(current_path, 'webdriver', 'edge', 'msedgedriver.exe')
# print(edge_path)

# driver = webdriver.Chrome(executable_path=chrome_path)
# driver.get("https://www.baidu.com")
#
# driver = webdriver.Firefox(executable_path=firefox_path)
# driver.get("https://www.baidu.com")
#
# driver = webdriver.Edge(executable_path=edge_path)
# driver.get("https://www.baidu.com")

# 可以判断当前是mac还是windows
system_driver = sys.platform

if system_driver.lower() == "darwin":
    print("当前是mac环境")
else:
    print("当前是windows环境")
